package cn.gene.timeyan.ams.webapi.controller;

import cn.gene.timeyan.ams.service.IAuditService;
import cn.gene.timeyan.ams.service.IViolationService;
import cn.gene.timeyan.common.restful.JsonResult;
import cn.gene.timeyan.pojo.admin.dto.AuditDTO;
import cn.gene.timeyan.pojo.admin.dto.ViolationDTO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 违规   前端控制器*
 *
 * @author LWG
 * @date 2022/7/21 16:56
 * @since 1.0.0@gene.cn
 */
@RestController
@RequestMapping("/ams/admin")
@Api(tags = "后台用户模块")
@Slf4j
public class ViolationController {

    /**
     * cyn
     */
    @Autowired
    private IViolationService service;

    @ApiOperation("封禁功能")
    @PostMapping("/addViolation")
    public JsonResult<Void> addNew(@Validated ViolationDTO violationDTO){
        log.info("dto====:{}",violationDTO);
       service.addViolation(violationDTO);
        return JsonResult.ok();
    }
}
